package com.example.administrator.testpersionn;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.tencent.mm.opensdk.modelpay.PayReq;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;

public class WeixinPayActivity extends AppCompatActivity {
    String url = "https://wxpay.wxutil.com/pub_v2/app/app_pay.php";

    String urdOrder="https://api.mch.weixin.qq.com/pay/unifiedorder";//
    IWXAPI msgApi = WXAPIFactory.createWXAPI(this, null);
    String appId="wxd930ea5d5a258f4f";//appid
    String mch_id="";//商户号
    String nonce_str="";//随机字符串
    String sign="";//签名字段
    String result_code="";//成功结果吗
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_weixin_pay);
        msgApi.registerApp(appId);


    }

    public void createId(View view) {

    }

    public void pay(View view) {
        PayReq request = new PayReq();
        request.appId = "wxd930ea5d5a258f4f";
        request.partnerId = "1900000109";
        request.prepayId= "1101000000140415649af9fc314aa427";
        request.packageValue = "Sign=WXPay";
        request.nonceStr= "1101000000140429eb40476f8896f4c9";
        request.timeStamp= "1398746574";
        request.sign= "7FFECB600D7157C5AA49810D2D8F28BC2811827B";
        msgApi.sendReq(request);
    }
}
